"""Header_Information
------------------------------------
    File_Name: config
    Author: RR9
    Date: 2024/09/18
    Description: 配置文件，使用Pydantic的BaseSettings类管理应用配置
------------------------------------
"""
from pydantic import BaseModel


class Settings(BaseModel):
    APP_NAME: str = "运维小网站"
    API_V1_STR: str = "/api/vv"
    SECRET_KEY: str = "999999999"

    class Config:
        env_file = ".env"


settings = Settings()

"""tortoise-rom 
"""
TORTOISE_ORM = {
    "connections": {
        "default": {
            "engine": "tortoise.backends.mysql",
            "credentials": {
                "host": "127.0.0.1",
                "port": "3306",
                "user": "root",
                "password": "root",
                "database": "fastApiStudy",
                "minsize": 1,
                "maxsize": 10,
                "charset": "utf8mb4",
                "echo": True
            }
        },
    },
    "apps": {
        "models": {
            "models": ["app.models", "aerich.models"],
            "default_connection": "default"
        }
    },
    "use_tz": False,
    "timezone": "Asia/Shanghai"
}

"""JWT
"""
SECRET_KEY = "1234567890"
ALGORITHM = "HS256"
ACCESS_TOKEN_EXPIRE_MINUTES = 60  # 分钟
